//
//  ForecastMapController.m
//  AirQuality
//
//  Created by Mac on 16/1/27.
//  Copyright © 2016年 Po. All rights reserved.
//

#import "ForecastMapController.h"
#import "MBProgressHUD+MJ.h"
#import "RJNavBar.h"

@interface ForecastMapController ()<UIWebViewDelegate>

@property (retain, nonatomic) UIWebView * webView;

- (void)userInterface;

@end

@implementation ForecastMapController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self userInterface];
    // Do any additional setup after loading the view.
}

- (void)userInterface{
    NSUserDefaults *userDefailt = [NSUserDefaults standardUserDefaults];
    NSArray *userInfo = [userDefailt objectForKey:@"userDefailt"];
    NSString *url = [[[NSString stringWithFormat:@"http://www.scnewair.cn:3389/publish/showImage.htm"] stringByAppendingString:[NSString stringWithFormat:@"?userName=%@",userInfo[0]]] stringByAppendingString:[NSString stringWithFormat:@"?userId=%@",userInfo[1]]];
    RJNavBar *navBar = [[RJNavBar alloc] init];
    [navBar getReturnButton];
    navBar.centerCityLabel.text = @"预报地图";
    _webView = [[UIWebView alloc] initWithFrame:CGRectMake(0,50 ,ScreenWidth, ScreenHeight-24)];
    _webView.delegate = self;
    _webView.scalesPageToFit = YES;//自动对页面进行缩放以适应屏幕
    //            _webView.detectsPhoneNumbers = YES;
    //                [_webView loadHTMLString: @"" baseURL: nil];
    [_webView loadRequest:[[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://www.scnewair.cn:3389/publish/showImage.html"]]];
    [self.view addSubview:_webView];
    [self.view addSubview:navBar];
}

- (void)webViewDidStartLoad:(UIWebView *)webView
{
    [MBProgressHUD showMessage:@"正在加载..."];
}

- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    [MBProgressHUD hideHUD];
}

@end
